#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int P = 100000000;
ll G[15], d[15][(1 << 13) + 10];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    while(cin >> n >> m){
        memset(d, 0, sizeof d);
        memset(G, 0, sizeof G);
        for (int i = 1; i <= n; ++i) {
            int s = 0;
            int t;
            for (int j = 1; j <= m; ++j) {
                cin >> t;
                s = (s << 1) + t;
            }
            G[i] = s;
        }
        d[0][0] = 1;
        for (int r = 1; r <= n; ++r) {
            for (int s = 0; s < 1 << m; ++s) {
                if ((s & G[r]) != s) continue;
                if ((s << 1) & s) continue;
                for (int ns = 0; ns < 1 << m; ++ns) {
                    if (s & ns) continue;
                    d[r][s] = (d[r][s] + d[r - 1][ns]) % P;

                }
            }
        }
        ll ans = 0;
        for (int i = 0; i < 1 << m; ++i) {
            ans = (ans + d[n][i]) % P;
        }
        cout << ans << endl;
    }


    return 0;
}